function lyt-defcmd
	# defin completion SUBCMDS for CMD of PROG
	set -l prog  $argv[1]
	set -l cmd $argv[2]
	set -l subcmds $argv[3]

	# echo $subcmds
	complete -c $prog \
		-n "__fish_seen_subcommand_from $cmd" \
		-n "not __fish_seen_subcommand_from $subcmds" \
		-a "$subcmds"

end



function lyt-defcmd-1
	# define SUBCMD for CMD, no hit for other hirachy
	set -l prog  $argv[1]
	set -l cmd $argv[2]
	set -l subcmds $argv[3]
	set -l subcmd $argv[4]
	set -l desc $argv[5]

	#echo $subcmds
	complete -c $prog \
		-n "__fish_seen_subcommand_from $cmd" \
		-n "not __fish_seen_subcommand_from $subcmds" \
		-a "$subcmd" -d "$desc"

end


function lyt-defcmd-F
	# defin completion SUBCMDS for CMD of PROG
	set -l prog  $argv[1]
	set -l cmd $argv[2]

	complete -c $prog \
		-n "__fish_seen_subcommand_from $cmd" \
		-F

end



function lyt-defcmd-root
	# complete CMDS for prog
	set -l prog  $argv[1]
	set -l cmds $argv[2]

	complete -c $prog -f
	complete -c $prog \
		-n "not __fish_seen_subcommand_from $cmds" \
		-a "$cmds"

end

function lyt-defcmd-root-1
	# complete CMDS for prog
	set -l prog  $argv[1]
	set -l cmd $argv[2]
	set -l cmds $argv[3]
	set -l desc $argv[4]


	complete -c $prog \
		-n "not __fish_seen_subcommand_from $cmds" \
		-a "$cmd" -d "$desc"

end


function lyt-defcmd-root-l
	# complete CMDS for prog
	set -l prog  $argv[1]
	set -l lflg $argv[2]
	set -l desc $argv[3]


	complete -c $prog \
		-l "$lflg" -d "$desc"

end


function lyt-defcmd-root-s
	# complete CMDS for prog
	set -l prog  $argv[1]
	set -l sflg $argv[2]
	set -l desc $argv[3]


	complete -c $prog \
		-s "$sflg" -d "$desc"

end



function lyt-defcmd-sl
	# complete CMDS for prog
	set -l prog  $argv[1]
	set -l cmd $argv[2]
	set -l sflg $argv[3]
	set -l lflg $argv[4]
	set -l desc $argv[5]


	complete -c $prog \
		-n "__fish_seen_subcommand_from $cmd" \
		-s "$sflg" -l "$lflg" -d "$desc"

end



function lyt-defcmd-s
	# complete CMDS for prog
	set -l prog  $argv[1]
	set -l cmd $argv[2]
	set -l sflg $argv[3]
	set -l desc $argv[4]


	complete -c $prog \
		-n "__fish_seen_subcommand_from $cmd" \
		-s "$sflg"  -d "$desc"

end


function lyt-defcmd-l
	# complete CMDS for prog
	set -l prog  $argv[1]
	set -l cmd $argv[2]
	set -l lflg $argv[3]
	set -l desc $argv[4]


	complete -c $prog \
		-n "__fish_seen_subcommand_from $cmd" \
		-l "$lflg"  -d "$desc"

end


